<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>压缩测试</title>
    <meta charset="UTF-8">
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body class="container">
<h3 class="mt-4">Deflate 压缩测试页面</h3>
<button class="btn btn-primary" onclick="testCompress()">测试压缩请求</button>
<pre id="result" class="mt-3 border p-3 bg-light"></pre>

<script>
    function testCompress() {
        fetch('/api/compress-demo', {
            headers: {'Accept-Encoding': 'deflate'}
        })
        .then(res => res.text())
        .then(data => {
            document.getElementById('result').innerText=data;
        });
    }
</script>
</body>
</html>